package org.compiere.tools;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.excel.read.Config;

public class TableFilter {
	public static Map tableNameMap = new HashMap();
	static {
		try {
			Config.generateTable("c:\\table_config.xls");
			FileReader fr = new FileReader(new File("c:\\table.txt"));
			BufferedReader bfr = new BufferedReader(fr);
			String str = null;
			while((str=bfr.readLine())!= null) {
				if(!str.trim().equalsIgnoreCase("")) {
					tableNameMap.put(str.trim(), str.trim());
				}
			}
				
		} catch (FileNotFoundException e) {			
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		tableNameMap.put("c_order", "c_order");
//		tableNameMap.put("c_orderline", "c_orderline");
//		tableNameMap.put("c_orderline", "c_orderline");
//		tableNameMap.put("r_mailtext", "r_mailtext");
		
		
	}
	
	public static void main(String args[]) {
		TableFilter.isIncluded("c_order");
	}
	public static boolean isIncluded(String tableName) {
		return tableNameMap.get(tableName.toLowerCase()) != null;

	}

}
